<div id="menu">
    <ul>
    	<% if logged_in? %>
    	<li>
    		欢迎你, <a class="login_user" href="http://<%= current_user.login %>.beyondrails.com" ><%= current_user.login %></a> <%= link_to "注销", logout_path, :class => "login_out" %>
		</li>
		<% else %>
		<li>
    		<a title="登录" class="login_out thickbox" href="/login?height=130&width=350">登录</a> <a class="login_out thickbox" title="注册" href="/signup?height=150&width=370">注册</a>
		</li>
		<% end %>
        <li>
            <ul>
                <li<% if @current_menu == :index %> class="current_page_item"<% end %>>
                    <a href="<%= HOME %>" title="首页">首页</a>
                </li>
                <li<% if @current_menu == :blog %> class="current_page_item"<% end %>>
                    <a href="<%= HOME %>/blogs" title="博客">博客</a><% if @current_menu == :blog %> <%= link_to image_tag("/images/blue_feed.png"), formatted_blogs_path(:rss), :class => "rss" %><% end %>
                </li>
                <li<% if @current_menu == :tutorial %> class="current_page_item"<% end %>>
                    <a href="<%= HOME %>/tutorials" title="教程">教程</a><% if @current_menu == :tutorial %> <%= link_to image_tag("/images/blue_feed.png"), formatted_tutorials_path(:rss), :class => "rss" %><% end %>
                </li>
                <li<% if @current_menu == :resource %> class="current_page_item"<% end %>>
                    <a href="<%= HOME %>/resources" title="资源">资源</a><% if @current_menu == :resource %> <%= link_to image_tag("/images/blue_feed.png"), formatted_resources_path(:rss), :class => "rss" %><% end %>
                </li>
                <li<% if @current_menu == :forum %> class="current_page_item"<% end %>>
                    <a href="<%= HOME %>/forums" title="论坛">论坛</a><% if @current_menu == :forum %> <%= link_to image_tag("/images/blue_feed.png"), formatted_forums_path(:rss), :class => "rss" %><% end %>
                </li>
				<li<% if @current_menu == :tag %> class="current_page_item"<% end %>>
	                <a href="<%= HOME %>/tags" title="标签">标签</a>
	            </li>
				<% if (!logged_in? && @user) || (logged_in? && @user && current_user.id != @user.id) %>
				<li class="current_page_item">
	                <a href="http://<%= @user.login %>.beyondrails.com" title="<%= @user.login %>的首页"><%= @user.login %>的首页</a> 
					<%= link_to image_tag("/images/blue_feed.png"), "http://#{@user.login}.beyondrails.com/index.rss", :class => "rss" %>
	            </li>
				<% end %>
				<% if logged_in? %>
				<li<% if @user && current_user.id == @user.id %> class="current_page_item"<% end %>>
	                <a href="http://<%= current_user.login %>.beyondrails.com" title="我的首页">我的首页</a> 
					<%= link_to image_tag("/images/blue_feed.png"), "http://#{current_user.login}.beyondrails.com/index.rss", :class => "rss" %>
	            </li>
				<% end %>
				<% if logged_in? && current_user.is_admin %>
				<li<% if @admin %> class="current_page_item"<% end %>>
	                <a href="<%= HOME %>/admin" title="后台管理">后台管理</a>
	            </li>
				<% end %>
            </ul>
        </li>
    </ul>
</div>